﻿@model List<Exam.Models.Product>
@{
    ViewBag.Title = "Manager";
}

<h2>商品管理</h2>

<legend>商品表</legend>
@Html.ActionLink("新增", "Add", new { }, new { @class = "btn btn-primary" })
<div class="table-responsive">
    <table class="table table-hover">
        <thead>
            <tr>
                <th>商品名</th>
                <th>价格</th>
                <th>详情</th>
                <th>编辑</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.PTitle</td>
                    <td>@item.Price</td>
                    <td>@item.PDetail</td>
                    <td>
                        @Html.ActionLink("修改", "Modify", new { id = item.PId }, new { @class = "btn btn-primary" })
                    @Html.ActionLink("删除", "Remove", "Home", new { id = item.PId }, new { @class = "btn btn-danger", @OnClick = "return confirm('确定要删除？');" })
                </td>
            </tr>
        }
        </tbody>
    </table>
</div>
